package com.plian.system.dao.sys.fun;

import com.plian.Tools.pagedata.PageData;
import com.plian.system.dao.DaoSupport;
import com.plian.system.model.page.Page;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;
@Component
public class PerGroupDao {
    @Resource(name = "daoSupport")
    private DaoSupport dao;
    public void save(PageData pd) throws Exception {
        dao.save("PerGroupMapper.save",pd);
    }
    public void  edit(PageData pd) throws Exception {
        dao.update("PerGroupMapper.edit",pd);
    }
    public PageData findbyid(String id) throws Exception {
        return (PageData) dao.findForObject("PerGroupMapper.findbyid",id);
    }
    public void del_ids(List<String> ids) throws Exception {
        dao.delete("PerGroupMapper.del_ids",ids);
    }
    public List<PageData> list(Page page) throws Exception {
       return (List<PageData>) dao.findForList("PerGroupMapper.listPage",page);
    }
    public List<PageData> listAll() throws Exception {
       return (List<PageData>) dao.findForList("PerGroupMapper.listAll",null);
    }

    public PageData findMaxCode() throws Exception {
        return (PageData) dao.findForObject("PerGroupMapper.findMaxCode",null);
    }
}
